A computer system may execute multiple sequences of instructions concurrently. A sequence of instructions may be provided by a user (e.g., a computer programmer) or by a machine. The concurrent execution of multiple sequences of instructions may be carried out by one or more processors associated with the computer system.
A computer system may have a memory of any size. The memory may be accessible by the multiple sequences of instructions. As the multiple sequences of instructions are executing concurrently, it may be important to prevent one sequence of instructions from observing the partial results of an operation being executed by another sequence of instructions.
Transactional memory allows a sequence of instructions to be defined as a transaction. A transaction is capable of accessing and/or modifying one or more memory locations of the shared memory in a single atomic step. Accordingly, one transaction cannot observe partial results of an operation being executed by another transaction. Transactional memory can be implemented in hardware and/or software.